// 引入request
import request from '@/utils/request.js'

// 封装获取面经列表
export const getArticleList = (current = 1, pageSize = 10, sorter = null) => {
  return request.get('/h5/interview/query', {
    params: {
      current: current,
      pageSize: pageSize,
      sorter: sorter
    }
  })
}

// 封装获取收藏喜欢列表查询
export const getCollectOrLike = (params) => {
  return request.get('/h5/interview/opt/list', { params })
}

// 封装单个面经详情方法
export const getArticleItems = (id) => {
  return request.get('/h5/interview/show', { params: { id } })
}

// 封装面经收藏喜欢题目接口
export const toggleCollectorLike = (id, optType) => {
  return request.post('/h5/interview/opt', { id, optType })
}

// 封装获取人员相关信息
export const getUserInfo = () => {
  return request.get('/h5/user/currentUser')
}
